<%@ page contentType="text/html;charset=utf-8"%>
<%@ page
	import="java.io.*, java.sql.*, java.util.*, java.text.*, napal.*, util.*"%>
<%@ page import="org.apache.ibatis.*"%>
<%
	request.setCharacterEncoding("utf-8");
%>
<%@ include file="./Header.jsp"%>
		</td>
		</TR>
		<TR HEIGHT="100">
		<td>
<div class="well"><font size = 7>보유 기자재 목록</font></div>

<%
String selectedCategory = request.getParameter("select01");
%>
	<form method="post">
		<select name="select01">
			<OPTION VALUE='카테고리선택'>카테고리선택</OPTION>

			<% for (Model g : RentalHome.category()) {%>
			<OPTION VALUE="<%=g.get카테고리명()%>"
				<%=g.get카테고리명().equals(selectedCategory) ? "selected" : "" %>><%=g.get카테고리명()%></OPTION>

			<%} %>

		</SELECT> <INPUT name="cmd" class="btn btn-inverse" TYPE="submit" VALUE="찾기">
	</form>
	<%
				if ("찾기".equals(request.getParameter("cmd"))) {
			%>


	<table class="table">
		<TR>
			<TD>카테고리명</TD>
			<TD>모델명</TD>
			<TD>보관사용처</TD>
			<TD>구매날짜</TD>
		</TR>
		<%
					for (EM g : RentalHome.categoryviewto(selectedCategory)) {
				%>

		<TR>
			<TD><%=g.get카테고리명()%></TD>
			<TD><%=g.get모델명()%></TD>
			<TD><%=g.get보관사용처()%></TD>
			<TD><%=g.get구매날짜()%></TD>
		</TR>
		<% }}%>
	</table>

	<input type="hidden" name="category" value="<%= selectedCategory %>" />
		</td>
		</tr>
		<TR HEIGHT="50">
			<TD><%@ include file="./bottom.jsp"%></TD>
		</TR>
	</TABLE>
</body>
</html>